/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.udesc.db;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author anderson
 */
@Entity
@Table(name = "fechamento_mensal")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FechamentoMensal.findAll", query = "SELECT f FROM FechamentoMensal f"),
    @NamedQuery(name = "FechamentoMensal.findById", query = "SELECT f FROM FechamentoMensal f WHERE f.id = :id"),
    @NamedQuery(name = "FechamentoMensal.findByCompetencia", query = "SELECT f FROM FechamentoMensal f WHERE f.competencia = :competencia"),
    @NamedQuery(name = "FechamentoMensal.findByDespesa", query = "SELECT f FROM FechamentoMensal f WHERE f.despesa = :despesa"),
    @NamedQuery(name = "FechamentoMensal.findByValor", query = "SELECT f FROM FechamentoMensal f WHERE f.valor = :valor"),
    @NamedQuery(name = "FechamentoMensal.findByTipoDespesa", query = "SELECT f FROM FechamentoMensal f WHERE f.tipoDespesa = :tipoDespesa")})
public class FechamentoMensal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "competencia")
    @Temporal(TemporalType.DATE)
    private Date competencia;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "despesa")
    private String despesa;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "valor")
    private BigDecimal valor;
    @Column(name = "tipo_despesa")
    private Character tipoDespesa;

    public FechamentoMensal() {
    }

    public FechamentoMensal(Integer id) {
        this.id = id;
    }

    public FechamentoMensal(Integer id, Date competencia, String despesa) {
        this.id = id;
        this.competencia = competencia;
        this.despesa = despesa;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getCompetencia() {
        return competencia;
    }

    public void setCompetencia(Date competencia) {
        this.competencia = competencia;
    }

    public String getDespesa() {
        return despesa;
    }

    public void setDespesa(String despesa) {
        this.despesa = despesa;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public Character getTipoDespesa() {
        return tipoDespesa;
    }

    public void setTipoDespesa(Character tipoDespesa) {
        this.tipoDespesa = tipoDespesa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FechamentoMensal)) {
            return false;
        }
        FechamentoMensal other = (FechamentoMensal) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.udesc.db.FechamentoMensal[ id=" + id + " ]";
    }
    
}
